package root.loan;

import exceptions.HasAlreadyDoneException;
import exceptions.LoanHasAlreadyBeenApprovedException;
import exceptions.PermissionDeniedException;

public abstract class State{	
	
	abstract public String getDescricao();
	
	public abstract void aproveBorrow(Borrow borrow) throws LoanHasAlreadyBeenApprovedException ,PermissionDeniedException;
	public abstract void cancel(Borrow borrow) throws HasAlreadyDoneException ,PermissionDeniedException;
	public abstract void complete(Borrow borrow) throws HasAlreadyDoneException ,PermissionDeniedException;
	public abstract void requestDevolution(Borrow borrow) throws HasAlreadyDoneException ,PermissionDeniedException;
	public abstract void returnItem(Borrow borrow) throws HasAlreadyDoneException ,PermissionDeniedException;

	public boolean isComplete() {
		return false;
	}

	public boolean isRequest() {
		return false;
	}

	public void mudaEstado(Borrow borrow, State state){
		borrow.mudaEstado(state);
	}
}
